package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.TireInv;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormLayout.Resize;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.MemoField;
import nl.coderight.jazz.form.field.TextField;

public class GeneralInfoAddEditTireToInventoryField extends GroupControl<TireInv>{
	private TextField IdenField;
	private TextField BrandField;
	private TextField ModelField;
	private TextField SizeField;
	private TextField TreadField;
	private TextField TractionField;
	private TextField LoadField;
	private TextField TypeField;
	private TextField StatusField;
	private TextField NotesField;
	
	public GeneralInfoAddEditTireToInventoryField(String bindID){
		setTitle("header.GeneralInformation");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		//Kalender
		/*Purchase_DateField = new CalendarControl ("Purchase Date", 20);
		Purchase_DateField.setFormat(new SimpleDateFormat ("Date.Format"));
		Purchase_DateField.showYearSpinner(true);*/
		
		//SpinnerField
		
		IdenField = new TextField ("serialNo", 20);
		IdenField.setRequired(true);
		
		SizeField = new TextField ("size", 20);
	
		
		TreadField = new TextField ("tread", 20);
		//TreadField.setRequired(true);
		
		TractionField = new TextField ("traction", 20);
		//TractionField.setRequired(true);
		
		LoadField = new TextField ("load", 20);
		//LoadField.setRequired(true);
		
		NotesField = new TextField ("notes", 20);
		//NotesField.setRequired(true);
		
		//combobox yg awal kosong
		BrandField = new TextField("make", 20);//kiri: nama table, kanan: data
		ModelField = new TextField("model", 20);
		TypeField = new TextField("type", 20);
		StatusField = new TextField("status", 20);
		/*StatusField.insert("In Service", true);
		StatusField.insert("Available", true);
		StatusField.insert("Scrapped", true);
		StatusField.insert("Mounted", true);
		*/
	}
	
	private void createLayout(){
		setLayout(new FormLayout())
		.addLabel("label.serialNo").addField(IdenField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.make").addField(BrandField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.model").addField(ModelField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.size").addField(SizeField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.tread").addField(TreadField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.load").addField(LoadField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.traction").addField(TractionField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.type").addField(TypeField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.status").addField(StatusField,Resize.HORIZONTAL)
		.addRow()
		.addLabel("label.notes").addField(NotesField,Resize.HORIZONTAL);
	}
}
